package com.uchonor.api.config;

import com.uchonor.api.core.factory.TemplateEngineFactory;
import com.uchonor.api.core.template.AbstractTemplateEngine;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class TemplateConfiguration {
    @Value("${template.type:freemarker}")
    private String templateType;

    @Bean
    public AbstractTemplateEngine getTemplateEngine(){
        return TemplateEngineFactory.getTemplateEngine(templateType);
    }
}
